<template>
	<Modal v-model="modal" title="退款详情">
		<Form ref="formValidate" :label-width="100">
			<FormItem label="评估单详情:">
				{{['待审核', '审核通过', '审核未通过','待支付','待完成','维修师已评估','发布者确认','待退款','退款完成','作废'][info.type]}}
			</FormItem>
			<FormItem label="单号">
				{{info.orderNum}}
			</FormItem>
			<FormItem label="提交日期:">
				{{info.createTime | timeForm}}
			</FormItem>
			<FormItem label="会员:">
				{{info.buyersTel }}
			</FormItem>
			<FormItem v-if="info.car">
				<div class="serve-img-box">
					<img :src="info.car.carPhoto" alt="" />
					<div class="_carName">
						<span>{{info.car.carName}}</span>
						<span>{{info.car.typeName}}</span>
					</div>
					<div class="_carMoney">
						{{info.car.carMoney}}万元
					</div>

				</div>
			</FormItem>
				<FormItem label='期望评估日期：' class="_border">
					{{info.expectTime | timeForm}}
				</FormItem>
				<FormItem label='订单截止日期：'>
					{{info.lastTime | timeForm}}
				</FormItem>
				<FormItem label='手机：'>
					{{info.tel }}
				</FormItem>
				<FormItem label='备注：'>
					{{info.note }}
				</FormItem>
			<div v-if="info.type!=0 && info.type!=1 && info.type!=2 && info.type!=9">
				<FormItem label='维修师：' class="_border" v-if='info.deliveryDate'>
					{{info.deliveryDate}}
				</FormItem>
				<FormItem label='电话：'>
					{{info.logisticsCompany }}
				</FormItem>
			</div>
			<div v-if="info.type!=0 && info.type!=1 && info.type!=2&& info.type!=3  && info.type!=9">
				<FormItem label='评估费用：' class="_border">
					{{info.appraiserMoney }}
				</FormItem>
				<FormItem label='支付方式：' v-if="info.order">
					{{['微信', '支付宝'][info.order.payType]}}
				</FormItem>
				<FormItem label='支付时间：'  v-if="info.order">
					{{info.order.createTime | timeForm}}
				</FormItem>
			</div>
			<div v-if="info.type!=0 && info.type!=1 && info.type!=2&& info.type!=3 && info.type!=4  && info.type!=9">
				<FormItem label='评估日期：' class="_border">
					{{info.submissionTime }}
				</FormItem>
			</div>
					
				
			
			
			<div v-if="info.type==5 || info.type==6 || info.type==7 || info.type==8 ">
				<FormItem label='提交日期：'>
					{{info.submissionTime | timeForm}}
				</FormItem>
				<FormItem label='描述符合程度：'>
					<Rate disabled  :value="info.conform"  v-if="info.conform"/>
				</FormItem>
				<FormItem label='图片：'>
			    
				</FormItem>
				<FormItem  v-if="imageList">
					<Row >
						<i-col span="6" v-for="(item,index) in imageList" :key="index">
							<div class="serve-img-box">
								<img :src="item" alt=""/>
							</div>
						</i-col>
					</Row>

				</FormItem>
				<FormItem label='备注：'>
					{{info.assessmentNote }}
				</FormItem>
				<FormItem label='确认日期：'>
					{{info.confirmTime | timeForm}}
				</FormItem>
			</div>

		</Form>
		<div slot="footer">
			<Button @click="cancel">返回</Button>
		</div>
	</Modal>
</template>

<script>
	export default {
		components: {
		},
		props: {
			type: String
		},
		data() {
			return {
				modal: false,
				info: {},
				assessmentId: 0,
				loadingBtn: false,
				modalType: '',
				imageList:[]
			}
		},
		methods: {

			show(res) {
				this.$nextTick(() => {
					this.modal = true
					this.assessmentId = res.row.assessmentId
					this.$http.post('/ossessment/byId', {
						id: res.row.assessmentId
					}).then(res => {
						if (res.status == 200) {
							if (res.data.code == 200) {
								this.info = res.data.data
								if(res.data.data.photo){
									this.imageList = res.data.data.photo.split(',')
								}
								
							}

						}

					})

				})

			},

			//取消
			cancel() {
				this.modal = false;
			},
			modalChange(state) {
				if (state) {

				} else {
					this.$refs.formValidate.resetFields()
				}
			}
		}
	}
</script>
<style scoped>
	.uploadSuccess {
		width: 200px;
		height: 100px;
	}

	.serve-img-box img {
		text-align: center;
		width: 80px;
		height: 60px;
	}

	._carName {
		display: inline-block;
		margin: 10px 0 0 10px;
		position: absolute
	}

	.ivu-form-item {
		margin-bottom: 2px;
	}

	._border {
		padding-top: 10px;
		border-top: 1px solid #D7DDE4;
	}
	._carMoney{
		display: inline-block;
		margin: 10px 0 0 130px;
		position: absolute;
	}
</style>
